package hczc.longcai.com.hccrowdfunding.home.fourth_mine.fragments;


import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;

import hczc.longcai.com.hccrowdfunding.R;
import hczc.longcai.com.hccrowdfunding.application.BaseApplication;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.FourthFragment;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.adapters.RewardOrdersAdapter;
import hczc.longcai.com.hccrowdfunding.home.fourth_mine.beans.RewardOrders;

/**
 * A simple {@link Fragment} subclass.
 */
public class RewardOrderDshFragment extends Fragment {


    private static final String TAG = "RewardOrderDshFragment";
    private ListView listView;
    private List<RewardOrders> list;
    private RewardOrdersAdapter adapter;

    public RewardOrderDshFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_reward_order_dsh, container, false);
        BaseApplication.scaleScreenHelper.loadView(((ViewGroup) view));


        initDatas();
        initViews(view);

        return view;
    }

    @Override
    public void onResume() {
        super.onResume();
//        Log.d(TAG,"dshFragment");

    }

    private void initDatas() {
        list = new ArrayList<>();
        list.add(new RewardOrders());
        list.add(new RewardOrders());

        list.add(new RewardOrders());

    }

    private void initViews(View view) {
        listView = ((ListView) view.findViewById(R.id.mine_reward_order_dsh_listview));
        adapter = new RewardOrdersAdapter(getActivity(),list, FourthFragment.STATE_DSH);
        listView.setAdapter(adapter);
    }

}
